package beans;

import java.util.ArrayList;
import java.util.List;

public class TaskboardViewBean {
	private List<TaskboardItemBean> taskboardList;
	
	public TaskboardViewBean() {
		taskboardList = new ArrayList<TaskboardItemBean>();
	}
	
	public void addRow(TaskboardItemBean taskboardItemBean) {
		taskboardList.add(taskboardItemBean);
	}
	
	public String getJson() {
		StringBuffer sb = new StringBuffer();

		sb.append("{ ");
		sb.append("\"row\": [");
		for (int i = 0; i < taskboardList.size(); i++) {
			TaskboardItemBean temp = taskboardList.get(i);
			sb.append(temp.getJson());
			if (i != taskboardList.size() - 1) {
				sb.append(",");
			}
		}
		sb.append("]");
		sb.append("}");
					
		return sb.toString();
	}

}
